From: kaf24@firebug.cl.cam.ac.uk Date: Wed, 17 May 2006 22:41:59 +0000 (+0100) Subject: Theoretically a 0 VIRT_BASE is okay. Change the bail code when X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16047^2~53 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=73e9ee97b4c3ccc5ab202625f71e22806325c553;p=xen.git Theoretically a 0 VIRT_BASE is okay. Change the bail code when parsing elf headers to bail only when VIRT_BASE is not specified at all. Signed-off-by: Keir Fraser --- diff --git a/tools/libxc/xc_load_elf.c b/tools/libxc/xc_load_elf.c index c09f819467..33b07bdb3f 100644 --- a/tools/libxc/xc_load_elf.c +++ b/tools/libxc/xc_load_elf.c @@ -148,16 +148,14 @@ static int parseelfimage(const char *image, dsi->xen_guest_string = guestinfo; - virt_base = 0; - if ( (p = strstr(guestinfo, "VIRT_BASE=")) != NULL ) - virt_base = strtoul(p+10, &p, 0); - - if ( virt_base == 0 ) + if ( (p = strstr(guestinfo, "VIRT_BASE=")) == NULL ) { - ERROR("Malformed ELF image. VIRT_BASE in '__xen_guest' section set incorrectly"); + ERROR("Malformed ELF image. No VIRT_BASE specified"); return -EINVAL; } + virt_base = strtoul(p+10, &p, 0); + dsi->elf_paddr_offset = virt_base; if ( (p = strstr(guestinfo, "ELF_PADDR_OFFSET=")) != NULL ) dsi->elf_paddr_offset = strtoul(p+17, &p, 0);